package hot;

import java.util.Arrays;
import java.util.stream.IntStream;

public class four {
    public static double findMedianSortedArrays(int[] nums1, int[] nums2) {
        int[] merged= IntStream.concat(Arrays.stream(nums1),Arrays.stream(nums2)).sorted()
                .toArray();
        if(merged.length%2==0){
            double mid=merged[merged.length/2]+merged[merged.length/2-1];
            return mid/2;
        }else{
            return merged[merged.length/2];
        }

    }

    public static void main(String[] args) {

    }
}
